package com.gopay.common.cps.manager.order;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import com.gopay.common.base.manager.BaseManager;
import com.gopay.common.domain.cps.CpsGenMainOrder;
import com.gopay.common.domain.cps.vo.FullCpsGenFundOrder;
import com.gopay.common.domain.cps.vo.FullCpsGenRecvOrder;

/**
 * 收款类订单VO查询
 * 
 * @FullCpsGenRecvOrderQueryManager.java
 * @author MA HUAN
 * @2013-1-8 下午7:02:43 www.gopay.com.cn Inc.All rights reserved.
 */
public interface FullCpsGenRecvOrderQueryManager extends BaseManager<FullCpsGenRecvOrder, Serializable> {

    /**
     * 按担保支付号获取原担保支付申请订单
     * 
     * @param authId
     * @return
     * @author GongZhong
     */
    public FullCpsGenRecvOrder findFullCpsGenRecvOrder(String authId);

    /**
     * 根据参数查询成功的订单
     * 
     * @param para
     * @return
     */
    public FullCpsGenRecvOrder findSuccessFullCpsGenRecvOrder(String merId, String merOrderId);

    public CpsGenMainOrder findByGopayOrderId(String orderId);

    public List<FullCpsGenRecvOrder> findFullCpsGenRecvOrder(String merId, String merOrderId);
    
    /**
     * 获取累计退款金额：累计成功退款 + 累计待审核退款金额
     * @param gopayOrderId
     * @return
     */
    public BigDecimal getTotalRefundAmt(String gopayOrderId);
    
    /**
     * 获取累计退还手续费金额：累计成功退还手续费 + 累计待审核退还手续费金额
     * @param gopayOrderId
     * @return
     */
    public BigDecimal getTotalRefundFeeAmt(String gopayOrderId);

    /**
     * 是否差额支付<br>
     * true：差额支付<br>
     * false：非差额支付
     * 
     * @param gopayOrderId
     * @return
     */
    public boolean isShortfallPay(String gopayOrderId);

    /**
     * 获取基金支付订单
     * @param merId
     * @param merOrderId
     * @return
     */
    public List<FullCpsGenFundOrder> findFullCpsGenFundOrder(String merId, String merOrderId);
    
    
    /**
     * 获取退款已用额度(包含进行中和成功的订单),用来校验退款额度是否超限
     * @param gopayOrderId
     * @return
     */
    public BigDecimal findTotal02RefundUsedLimit(String gopayOrderId);

}
